package cn.xscrum.vtsp.service.impl;

import java.util.List;
import cn.xscrum.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.xscrum.vtsp.mapper.VtspActivityAppraiseMapper;
import cn.xscrum.vtsp.domain.VtspActivityAppraise;
import cn.xscrum.vtsp.service.IVtspActivityAppraiseService;
import cn.xscrum.common.core.text.Convert;

/**
 * 活动评价信息Service业务层处理
 * 
 * @author xscrum
 * @date 2021-10-20
 */
@Service
public class VtspActivityAppraiseServiceImpl implements IVtspActivityAppraiseService 
{
    @Autowired
    private VtspActivityAppraiseMapper vtspActivityAppraiseMapper;

    /**
	 * 查询活动评价信息
     * 
     * @param appraiseId 活动评价信息ID
     * @return 活动评价信息
     */
    @Override
    public VtspActivityAppraise selectVtspActivityAppraiseById(Long appraiseId)
    {
        return vtspActivityAppraiseMapper.selectVtspActivityAppraiseById(appraiseId);
    }

    @Override
    public VtspActivityAppraise selectVtspActivityAppraiseById2(Long enrollId) {
        return vtspActivityAppraiseMapper.selectVtspActivityAppraiseById2(enrollId);
    }

    /**
	 * 查询活动评价信息列表
     * 
     * @param vtspActivityAppraise 活动评价信息
     * @return 活动评价信息
     */
    @Override
    public List<VtspActivityAppraise> selectVtspActivityAppraiseList(VtspActivityAppraise vtspActivityAppraise)
    {
        return vtspActivityAppraiseMapper.selectVtspActivityAppraiseList(vtspActivityAppraise);
    }

    /**
	 * 新增活动评价信息
     * 
     * @param vtspActivityAppraise 活动评价信息
     * @return 结果
     */
    @Override
    public int insertVtspActivityAppraise(VtspActivityAppraise vtspActivityAppraise)
    {
        vtspActivityAppraise.setCreateTime(DateUtils.getNowDate());
        return vtspActivityAppraiseMapper.insertVtspActivityAppraise(vtspActivityAppraise);
    }

    /**
	 * 修改活动评价信息
     * 
     * @param vtspActivityAppraise 活动评价信息
     * @return 结果
     */
    @Override
    public int updateVtspActivityAppraise(VtspActivityAppraise vtspActivityAppraise)
    {
        vtspActivityAppraise.setUpdateTime(DateUtils.getNowDate());
        return vtspActivityAppraiseMapper.updateVtspActivityAppraise(vtspActivityAppraise);
    }

    /**
	 * 删除活动评价信息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteVtspActivityAppraiseByIds(String ids)
    {
        return vtspActivityAppraiseMapper.deleteVtspActivityAppraiseByIds(Convert.toStrArray(ids));
    }

    /**
	 * 删除活动评价信息信息
     * 
     * @param appraiseId 活动评价信息ID
     * @return 结果
     */
    @Override
    public int deleteVtspActivityAppraiseById(Long appraiseId)
    {
        return vtspActivityAppraiseMapper.deleteVtspActivityAppraiseById(appraiseId);
    }
}
